package kaist.sep521.lego.circlebicycle;

import java.util.ArrayList;

public class Group {
	private String name = null;
	private String info = null;
	private ArrayList<String> member =  null;
	private int number = 0;

	// clear
	public void clear() {
		this.member.clear();
		this.name = null;
		this.member = null;
		this.number = 0;
		this.info = null;
	}

	// set value
	public void setName(String name) {
		this.name = name;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	public void addMember(String user) {
		if ( this.member == null )
			this.member =  new ArrayList<String>();

		this.member.add(user);
		this.number++;
	}

	public void removeMember(String user) {
		int size = this.member.size();

		for (int i = 0; i < size; i++) {
			if (this.member.get(i).equals(user) == true) {
				this.member.remove(i);
			}
		}
		this.number--;
	}

	// get value
	public String getName() {
		return this.name;
	}

	public String getInfo() {
		return this.info;
	}

	public ArrayList<String> getMember() {
		return this.member;
	}

	public int getNumber() {
		return this.number;
	}

}
